package com.example.demo.dto;

public class UserDTO {
    private Integer userId;       // 用户ID
    private String authId;        // 统一认证号
    private String userName;      // 中文名
    private String email;         // 邮箱
    private Integer deptId;       // 所属部门ID
    private String deptName;      // 所属部门中文名
    private String userType;      // 用户类型，如开发、测试、运维等

    // 从实体类转换为DTO
    public static UserDTO fromEntity(com.example.demo.entity.User entity) {
        UserDTO dto = new UserDTO();
        dto.setUserId(entity.getUserId());
        dto.setAuthId(entity.getAuthId());
        dto.setUserName(entity.getUserName());
        dto.setEmail(entity.getEmail());
        dto.setDeptId(entity.getDeptId());
        dto.setDeptName(entity.getDeptName());
        dto.setUserType(entity.getUserType());
        return dto;
    }

    // Getters and Setters
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getAuthId() {
        return authId;
    }

    public void setAuthId(String authId) {
        this.authId = authId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }
}